home *** CD-ROM | disk | FTP | other *** search
/ Champak 130 / Vol 130.iso / games / target_s.swf / scripts / soundEngine.as < prev    next >
Encoding:
Text File  |  2008-11-13  |  2.5 KB  |  92 lines

  1. package
  2. {
  3.    import flash.media.Sound;
  4.    import flash.media.SoundChannel;
  5.    import flash.media.SoundMixer;
  6.    import flash.media.SoundTransform;
  7.    
  8.    public class soundEngine extends Sound
  9.    {
  10.        
  11.       
  12.       public var rollSound:Sound;
  13.       
  14.       public var bail1Sound:Sound;
  15.       
  16.       public var soundON:Boolean = true;
  17.       
  18.       public var bail1Channel:SoundChannel;
  19.       
  20.       public var softlandChannel:SoundChannel;
  21.       
  22.       public var cheerSound:Sound;
  23.       
  24.       public var ollieSound:Sound;
  25.       
  26.       public var rollChannel:SoundChannel;
  27.       
  28.       private var scope:Object;
  29.       
  30.       public var bgSound:Sound;
  31.       
  32.       public var cheerChannel:SoundChannel;
  33.       
  34.       public var ollieChannel:SoundChannel;
  35.       
  36.       public var softlandSound:Sound;
  37.       
  38.       public var bgChannel:SoundChannel;
  39.       
  40.       public function soundEngine(param1:*)
  41.       {
  42.          soundON = true;
  43.          bgSound = new bgMusic();
  44.          bgChannel = new SoundChannel();
  45.          rollSound = new skate_roll();
  46.          rollChannel = new SoundChannel();
  47.          ollieSound = new skate_clack();
  48.          ollieChannel = new SoundChannel();
  49.          softlandSound = new skate_softland2();
  50.          softlandChannel = new SoundChannel();
  51.          bail1Sound = new skate_bail2();
  52.          bail1Channel = new SoundChannel();
  53.          cheerSound = new skate_finishCheer();
  54.          cheerChannel = new SoundChannel();
  55.          super();
  56.          scope = param1;
  57.       }
  58.       
  59.       public function setVolume(param1:String, param2:Number) : *
  60.       {
  61.          var _loc3_:* = undefined;
  62.          _loc3_ = this[param1 + "Channel"].soundTransform;
  63.          _loc3_.volume = param2;
  64.          this[param1 + "Channel"].soundTransform = _loc3_;
  65.       }
  66.       
  67.       public function stopSound(param1:String) : *
  68.       {
  69.          this[param1 + "Channel"].stop();
  70.       }
  71.       
  72.       public function restartSounds() : *
  73.       {
  74.          startSound("bg",0,9999,0.5,0);
  75.          startSound("roll",0,9999,0,0);
  76.       }
  77.       
  78.       public function startSound(param1:String, param2:Number, param3:Number, param4:Number, param5:Number) : *
  79.       {
  80.          if(soundON)
  81.          {
  82.             this[param1 + "Channel"] = this[param1 + "Sound"].play(param2,param3,new SoundTransform(param4,param5));
  83.          }
  84.       }
  85.       
  86.       public function stopSounds() : *
  87.       {
  88.          SoundMixer.stopAll();
  89.       }
  90.    }
  91. }
  92.